#define _CRT_SECURE_NO_WARNINGS
#include "list.h"
#include <list>
#include <iostream>

using std::cout;
using std::cin;
using std::endl;


void test1()
{
	using namespace wyd;
	list<int> ls1;
	ls1.push_back(1);
	//ls1.push_back(2);
	//ls1.push_back(3);
	//ls1.push_back(4);

	list<int>::iterator it = ls1.begin();
	while (it != ls1.end())
	{
		cout << *it << ' ';
		++it;
	}
	cout << endl;

	ls1.clear();
	it = ls1.begin();
	while (it != ls1.end())
	{
		cout << *it << ' ';
		++it;
	}
	cout << endl;

	//++it;
	//cout << *it << endl;
	//++it;
	//cout << *it << endl;
	//++it;
	//cout << *it << endl;
	//++it;
	//cout << *it << endl;
}

void std_test1()
{
	using namespace std;
	list<int> ls;
	ls.push_back(1);

	ls.insert(ls.begin(), 1);

	list<int>::iterator it = ls.begin();
	while (it != ls.end())
	{
		cout << *it << ' ';
		++it;
	}
	cout << endl;
	++it;

}

template <class firstIterator, class lastIterator>
void Print(firstIterator it1, lastIterator it2)
{
	while (it1 != it2)
	{
		cout << *it1 << ' ';
		++it1;
	}
	cout << endl;
}

void test2()
{
	using namespace wyd;
	list<int> ls1;
	ls1.push_back(1);
	ls1.push_back(2);
	ls1.push_back(3);

	list<int> ls2(ls1);
	Print(ls1.begin(), ls1.end());
	Print(ls2.begin(), ls2.end());

}

int main()
{
	test2();
	return 0;
}